<?php
trait Counter{
    static $c=0;
    public function inc(){
        $this->c=$this->c+1;
        echo "$this->c\n";
    }
 
    
}
class C1{
    use Counter;
}
 
$o=new C1();
$o->inc();
$o->inc();
$o->inc();
$o->inc();
 